package com.example.fitness;

import database.dbCreation;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.widget.Button;

public class MainActivity extends Activity {
	
	Button login_btn;
	Intent nextActivity;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
//		dbCreation dbc = new dbCreation();
		/************************* Database Test *************************/
		dbCreation.DbHelper db = new dbCreation.DbHelper(this);
		db.getReadableDatabase();
		db.getWritableDatabase();
		/************************* Database Test *************************/
		
		login_btn = (Button) findViewById(R.id.login_btn);
		
	
	login_btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
        	//validate login credentials, go to welcome screen if credentials are correct.
        	nextActivity = new Intent(MainActivity.this, WelcomeScreen.class);
        	nextActivity.putExtra("UserName", "Wei Han");
    		startActivityForResult(nextActivity, 1);
        }
    });
	
	}
}
